TextEditor currently only works on MacOS computer with a PowerPC processor. There is no 68K version available.
Introduction
Based on Textension, this part is similar to SimpleText. It supports Mac TEXT data as well as native data formats. In addition to the features implemented in SamplePart, this part adds the following functionality:
- SOM class implementation
- handling of part menus
- drag and drop
- scrolling (when root of document)
- international TSM support
- preferences file
- settings and preferences dialogs
- supports Semantic Interface to handle TSM Apple events
- multiple kind support
- support for ScriptRunner
Gotchas
• TextEditor's scroll bars will behave incorrectly with long documents. This is as a result of the Control Manager's 16-bit limitation of the maximum of a Control. TextEditor doesn't attempt to work around this limitation, so once the document becomes more than 32767 pixels tall, this problem occurs.
• TextEditor does not handle multiple kinds, particularly the ExternalizeKinds function, as well as it could. The ExternalizeKinds function is currently not called by the OpenDoc 1.0 shell, though it may be called by Container Applications and may be called in future versions of OpenDoc. The problem lies in the fact that TextEditor does not currently externalize all of the kinds requested of it — bases the set of kinds it externalizes solely on the preferred kind.
• TextEditor does not correctly support being embedded in a link destination. The Cappuccino sample part handles these cases correctly.
To correctly handle being in a link destination, you should get the link status of a frame before trying to edit it. If it is a link destination, you should call EditInLink, and if EditInLink returns kODTrue, you should check the link status again -- this time, if it is still in a destination link, you should not allow the change to occur, otherwise, you should go ahead and make the change.
• TextEditor doesn't handle multiple display frames and will try to prevent them from being created. This is counter to the intended human interface of OpenDoc parts.
• TextEditor does not currently handle sequenced frames.
• There is some code indicating the potential existence of a ruler window that would allow adjusting of tab stops, etc. This window never got implemented.
• TextEditor does not support embedding of other parts.
• TextEditor is based on a custom version of the Textension text editing engine written by Apple. Source code for Textension is not distributed with TextEditor. Instead, a library (.lib) file is included. This library file will only work with CodeWarrior 6 (that is, it will not work with other compilers or other versions of CodeWarrior). Because of these and other issues, TextEditor is not a good starting place for other parts (which is why there is no PartMaker document for it), although it may serve as a good example of how to do certain things with OpenDoc.
• In order to compile TextEditor, ScriptRunner must be available. There should be an access path that includes the ScriptRunner folder in the CodeWarrior preferences dialog. Also, in order to rebuild the IDL files, ScriptRunner must be available and you must put the path to ScriptRunner into TextEditor.make if it is different than the relative path that is included in that file.